import java.sql.SQLSyntaxErrorException;
import java.util.*;
public class BiteDay38 {
    private static int cnt = 0;

    private static boolean check(int x, int y, char[][] arr){
        if(x < arr.length && x >= 0
        && y < arr[x].length && y >= 0
        && arr[x][y] == '.'){
            return true;
        }
        return false;
    }
    private static void dfs(int x, int y, char[][] arr){
        arr[x][y] = '#';
        cnt++;
        if(check(x - 1, y, arr)){
            dfs(x - 1, y, arr);
        }
        if(check(x + 1, y, arr)){
            dfs(x + 1, y, arr);
        }
        if(check(x, y + 1, arr)){
            dfs(x, y + 1, arr);
        }
        if(check(x, y - 1, arr)){
            dfs(x, y - 1, arr);
        }
    }
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextInt()){
            int m = sc.nextInt();
            int n = sc.nextInt();
            char[][] arr = new char[m][n];
            int x = 0;
            int y = 0;
            for(int i = 0; i < m; i++){
                String s = sc.next();
                arr[i] = s.toCharArray();
                for(int j = 0; j < n; j++){
                    if(arr[i][j] == '@'){
                        x = i;
                        y = j;
                    }
                }
            }
            dfs(x,y,arr);
            System.out.println(cnt);
            cnt = 0;
        }
    }

    static class Situation{
        int total;
        int have;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int k = sc.nextInt();
        int[][] arr = new int[N][M];
        for(int i = 0; i < k; i++){
            int x = sc.nextInt()-1;
            int y = sc.nextInt()-1;
            arr[x][y] = 1;
        }
        Situation[][] dp = new Situation[N][M];
        int flag = 0;

        for(int i = 0; i < M; i++){
            dp[0][i] = new Situation();
            if(flag == 1){
                dp[0][i].total = 1;
                dp[0][i].have = 1;
            }else{
                if(arr[0][i] == 1){
                    flag = 1;
                    dp[0][i].total = 1;
                    dp[0][i].have = 1;
                }else{
                    dp[0][i].total = 1;
                    dp[0][i].have = 0;
                }
            }
        }
        flag = 0;
        for(int i = 0; i < N; i++){
            dp[i][0] = new Situation();
            if(flag == 1){
                dp[i][0].total = 1;
                dp[i][0].have = 1;
            }else{
                if(arr[i][0] == 1){
                    flag = 1;
                    dp[i][0].total = 1;
                    dp[i][0].have = 1;
                }else{
                    dp[i][0].total = 1;
                    dp[i][0].have = 0;
                }
            }
        }

        for(int i = 1; i < N; i++){
            for(int j = 1; j < M; j++){
                dp[i][j] = new Situation();
                dp[i][j].total = dp[i - 1][j].total + dp[i][j-1].total;
                dp[i][j].have = dp[i - 1][j].have + dp[i][j-1].have + arr[i][j];
            }
        }
        int a = dp[N-1][M-1].total - dp[N-1][M-1].have;
        int b = dp[N-1][M-1].total;
        System.out.printf("%.2f", (double)a / b);
    }
}
